import { createApp } from "vue";
import App from "./App.vue";

import "element-plus/dist/index.css";

import router from "./router";

import store from "./store";

import HyRequest from "./service";
// 全局引入
import ElementPlus from "element-plus";
import axios from "axios";

axios.defaults.baseURL =
  process.env.NODE_ENV === "production" ? "http://8.130.32.196:1452" : "/api";
// 按需引入
// import { globalRegister } from "./global";
// 如果您正在使用CDN引入，请删除下面一行。
import * as ElementPlusIconsVue from "@element-plus/icons-vue";
import "normalize.css";
import "./assets/css/index.less";
import zhCn from "element-plus/dist/locale/zh-cn.mjs";
import "element-plus/theme-chalk/dark/css-vars.css";
import "@/styles/dark/css-vars.css";
// 注册emelment-ui
const app = createApp(App);
// 按需引入注册
// globalRegister(app);
// 全局引入注册
app.use(ElementPlus);
app.use(router);
app.use(store);
app.use(ElementPlus, {
  locale: zhCn
});
app.mount("#app");
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
  app.component(key, component);
}
